<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局</title>
    <style>
        .con {
            width: 300px;
            height: 300px;
            border: 3px solid;


        }

        @media screen and (max-width:400px) {
            .con{
                background-color: slategray ;
            }
        }
        @media screen and (max-width:800px) and ( min-width:400px){
            .con{
                background-color: red;
            }
            
        }
        @media screen and  ( min-width:600px){
            .con{
                background-color: blue;
            }
            
        }
    </style>
</head>

<body>
    <div class="con">

    </div>

</body>

</html>